from django.db import models
from django.utils import timezone
from django.db.models.functions import Now

class YongHu(models.Model):
    id = models.AutoField(primary_key=True,  null=False, verbose_name='自增主键')
    username = models.CharField(max_length=20, blank=True, default='', null=False, verbose_name='用户名')
    email = models.CharField(max_length=50, blank=True, default='', null=False, verbose_name='邮箱')
    password = models.CharField(max_length=32, blank=True, default='', null=False, verbose_name='密码')
    salt = models.CharField(max_length=10, blank=True, default='', null=False, verbose_name='密码对应的随机数')
    create_time = models.DateTimeField(auto_now_add=Now(), verbose_name='创建时间')
    update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间')

    class Meta:
        db_table = 'yonghu'
        verbose_name = '用户表'